package ClassWork.Work_01;

import java.util.Scanner;

public class Number {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter a number: ");
        int num = sc.nextInt();
        int count = add(num);
        System.out.println("输入的是" + count + "位数");
    }
    public static int add(int n){
        int count = 0;
        while(true){
            if(n/10==0){
                count++;
                break;
            }
            n /= 10;
            count++;
        }
        return count;
    }
}
